<template>
  <a-popconfirm
    title="确认导出该云端设备吗？"
    ok-text="确认"
    cancel-text="取消"
    @confirm="confirm"
    @cancel="cancel"
  >
    <ExportOutlined
      title="导出设备"
      style="color: green"
      class="cursor-pointer svg-scale"
    />
  </a-popconfirm>
</template>

<script lang="ts">
import { defineComponent, PropType } from "vue";
import { ExportOutlined } from "@ant-design/icons-vue";
import { CloudDevice } from "model";
import { exportDeviceExcel } from "@/utils/export.js";

export default defineComponent({
  name: "ExportConfirm",
  components: {
    ExportOutlined,
  },
  props: {
    device: {
      type: Object as PropType<CloudDevice>,
      required: true,
    },
  },
  setup(props) {
    const confirm = async () => {
      console.log("export", props.device);
      exportDeviceExcel(props.device);
    };
    const cancel = () => {
      console.log("cancel");
    };
    return { confirm, cancel };
  },
});
</script>

<style scoped lang="scss"></style>
